#pragma once
#include "Socket.h"
#include "EventLoop.h"
#include <string>
#include "Channel.h"
#include "InetAddress.h"
#include "Epoll.h"
#include "Acceptor.h"
#include<map>

// TcpServer网路服务类
class TcpServer
{
public:
    TcpServer(std::string &ip, uint16_t &port);
    ~TcpServer();

    void start();
    void newConnection(Socket *clientsock);



private:
    EventLoop loop_;
    Acceptor *acceptor_;
    std::map<int,Connection*> conns_;
};
